package com.huluobo.higt4demo1911.model;

import com.huluobo.higt4demo1911.api.Api;
import com.huluobo.higt4demo1911.bean.VideoBean;
import com.huluobo.higt4demo1911.contract.VideoContract;
import com.huluobo.higt4demo1911.core.http.base.HttpFactory;
import com.huluobo.higt4demo1911.core.http.base.ProductType;
import com.huluobo.higt4demo1911.core.http.call.CallObserver;
import com.huluobo.higt4demo1911.core.mvp.BaseModel;

import java.util.List;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by lc on 2022/4/20.
 */
public class VideoModel extends BaseModel implements VideoContract.Model {
    @Override
    public void requestVideos(CallObserver<List<VideoBean>> observer) {
        HttpFactory.getInstance().create(ProductType.NETWORK).getRetrofit()
                .create(Api.class)
                .videoList("1", "1", "20")
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }
}
